<template>
    <div>
<p>count的值是：{{  count}}</p>
<button @click="add">++++</button>
    </div>
</template>

<script setup>
import { ref, reactive} from 'vue'
const emit = defineEmits(['updateCount'])
const count = ref(1);
const add =() => {
    count.value++;
    emit('updateCount',2)
}
</script>

<style  scoped>

</style>